package com.taxshare.api.controller;


import com.taxshare.api.service.PurchaserInvoiceService;
import com.taxshare.api.view.dto.CheckInvoiceDTO;

import com.taxshare.api.view.dto.ImageUploadInvoiceDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author YANG
 * @date 2021/4/6
 */
@RestController
@RequestMapping("/purchaser")
public class PuchaserInvoiceController {

    @Autowired
    PurchaserInvoiceService purchaserInvoiceService;

    @PostMapping("/invoiceCheck")
    @ApiOperation(value = "进项发票查验", notes = "进项Api")
    public Response invoiceCheck(@RequestBody CheckInvoiceDTO checkInvoiceReq) {
        return purchaserInvoiceService.invoiceCheck(checkInvoiceReq);
    }

    @PostMapping("/invoiceImageRecognition")
    @ApiOperation(value = "进项发票识别", notes = "进项Api")
    public Response invoiceImageRecognition(@RequestBody ImageUploadInvoiceDTO imageUploadInvoiceDTO) {
        return purchaserInvoiceService.invoiceImageRecognition(imageUploadInvoiceDTO);
    }
}
